rm -rf $(D)/usr/$(LIBDIR)/libxenctrl* $(D)/usr/$(LIBDIR)/libxenguest*
rm -rf $(D)/usr/$(LIBDIR)/libxenstore*
rm -rf $(D)/usr/$(LIBDIR)/python/xen $(D)/usr/$(LIBDIR)/xen
- rm -rf $(D)/usr/libexec/xen
+ rm -rf $(D)/usr/$(LIBDIR)/xen/bin
rm -rf $(D)/usr/sbin/xen* $(D)/usr/sbin/netfix $(D)/usr/sbin/xm
rm -rf $(D)/usr/share/doc/xen
rm -rf $(D)/usr/share/xen
include $(XEN_ROOT)/tools/Rules.mk
DAEMON_INSTALL_DIR = /usr/sbin
-CLIENT_INSTALL_DIR = /usr/libexec/xen
+CLIENT_INSTALL_DIR = /usr/$(LIBDIR)/xen/bin
INSTALL = install
INSTALL_PROG = $(INSTALL) -m0755
# -*- mode: python; -*-
#============================================================================
# Copyright (C) 2004 Mike Wray <mike.wray@hp.com>
+# Copyright (C) 2005 XenSource Ltd
#============================================================================
-"""Xen management daemon. Lives in /usr/sbin.
+"""Xen management daemon.
Provides console server and HTTP management api.
Run:
def start_xenstored():
XENSTORED_TRACE = os.getenv("XENSTORED_TRACE")
- cmd = "/usr/sbin/xenstored --pid-file=/var/run/xenstore.pid"
+ cmd = "xenstored --pid-file=/var/run/xenstore.pid"
if XENSTORED_TRACE:
cmd += " -T /var/log/xenstored-trace.log"
s,o = commands.getstatusoutput(cmd)
def start_consoled():
if os.fork() == 0:
- os.execvp('/usr/sbin/xenconsoled', ['/usr/sbin/xenconsoled'])
+ os.execvp('xenconsoled', ['xenconsoled'])
def main():
try:
import re
import sys
-os.defpath = os.defpath + ':/sbin:/usr/sbin:/usr/local/sbin'
CMD_IFCONFIG = 'ifconfig'
CMD_ROUTE = 'route'
CMD_BRCTL = 'brctl'
from xen.util.xpopen import xPopen3
+import xen.util.auxbin
+
import xen.lowlevel.xc
from xen.xend.xenstore.xsutil import IntroduceDomain
from XendError import XendError
from XendLogging import log
+
SIGNATURE = "LinuxGuestRecord"
-PATH_XC_SAVE = "/usr/libexec/xen/xc_save"
-PATH_XC_RESTORE = "/usr/libexec/xen/xc_restore"
+XC_SAVE = "xc_save"
+XC_RESTORE = "xc_restore"
+
sizeof_int = calcsize("i")
sizeof_unsigned_long = calcsize("L")
# enabled. Passing "0" simply uses the defaults compiled into
# libxenguest; see the comments and/or code in xc_linux_save() for
# more information.
- cmd = [PATH_XC_SAVE, str(xc.handle()), str(fd),
+ cmd = [xen.util.auxbin.pathTo(XC_SAVE), str(xc.handle()), str(fd),
str(dominfo.getDomid()), "0", "0", str(int(live)) ]
log.debug("[xc_save]: %s", string.join(cmd))
store_evtchn = dominfo.store_channel
console_evtchn = dominfo.console_channel
- cmd = [PATH_XC_RESTORE, str(xc.handle()), str(fd),
+ cmd = [xen.util.auxbin.pathTo(XC_RESTORE), str(xc.handle()), str(fd),
str(dominfo.getDomid()), str(nr_pfns),
str(store_evtchn), str(console_evtchn)]
log.debug("[xc_restore]: %s", string.join(cmd))
pythonex = '(?P<python>\S*python\S*)'
cmdex = '(?P<cmd>.*)'
procre = re.compile('^\s*' + pidex + '\s*' + pythonex + '\s*' + cmdex + '$')
- xendre = re.compile('^/usr/sbin/xend\s*(start|restart)\s*.*$')
+ xendre = re.compile('^\S+/xend\s*(start|restart)\s*.*$')
procs = os.popen('ps -e -o pid,args 2>/dev/null')
for proc in procs:
pm = procre.match(proc)
-#!/usr/bin/python
+#!/usr/bin/env python
#============================================================================
# This library is free software; you can redistribute it and/or
# modify it under the terms of version 2.1 of the GNU Lesser General Public
#============================================================================
# Copyright (C) 2004, 2005 Mike Wray <mike.wray@hp.com>
# Copyright (C) 2005 Nguyen Anh Quynh <aquynh@gmail.com>
+# Copyright (C) 2005 XenSource Ltd
#============================================================================
"""Domain creation.
"""
import random
+import os
+import os.path
import string
import sys
import socket
from xen.xm.opts import *
+import console
+
+
gopts = Opts(use="""[options] [vars]
Create a domain.
dom = make_domain(opts, config)
if opts.vals.console_autoconnect:
- cmd = "/usr/libexec/xen/xenconsole %d" % dom
- os.execvp('/usr/libexec/xen/xenconsole', cmd.split())
+ console.execConsole(dom)
if __name__ == '__main__':
main(sys.argv)
from xen.xend import sxp
from xen.xm.opts import *
+import console
+
shorthelp = """Usage: xm <subcommand> [args]
Control, list, and manipulate Xen guest instances
from xen.xend.XendClient import server
info = server.xend_domain(dom)
domid = int(sxp.child_value(info, 'domid', '-1'))
- cmd = "/usr/libexec/xen/xenconsole %d" % domid
- os.execvp('/usr/libexec/xen/xenconsole', cmd.split())
- console = sxp.child(info, "console")
+ console.execConsole(domid)
+
def xm_top(args):
- os.execv('/usr/sbin/xentop', ['/usr/sbin/xentop'])
+ os.execvp('xentop', ['xentop'])
def xm_dmesg(args):
XEN_ROOT = ../..
include $(XEN_ROOT)/tools/Rules.mk
-PROGRAMS_INSTALL_DIR = /usr/libexec/xen
+PROGRAMS_INSTALL_DIR = /usr/$(LIBDIR)/xen/bin
INCLUDES += -I $(XEN_LIBXC)